package database

import (
	"log"
	"windsurf-project/internal/infrastructure/config"

	"gorm.io/gorm"
)

type DB struct {
	*gorm.DB
}

func NewDB() *DB {
	db, err := config.InitDatabase()
	if err != nil {
		log.Fatal("Failed to initialize database:", err)
	}

	return &DB{db}
}

func (d *DB) GetDB() *gorm.DB {
	return d.DB
}
